package book;

/**
 * Created with IntelliJ IDEA.
 * Description:与书相关
 * User: wx
 * Date: 2023-11-14
 * Time: 14:26
 */
public class Book {
    private  String name;
    private  String author;
    private  int price;
    private boolean isborrowed;
    private  String type;



    public Book(String name, String author, int price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;

    }
    public void setIsborrowed(boolean isborrowed) {
        this.isborrowed = isborrowed;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isIsborrowed() {
        return isborrowed;
    }





    @Override
    public String toString() {
        return "book[" +
                "name='" + name + ' ' +
                "author='" + author + ' ' +
                "price=" + price +
                "type='" + type + ' ' +
                ((isborrowed == true) ? "已被借出" : "未被借出") +
                /*"Isborrowed=" + Isborrowed +*/
                ']';
    }
}
